package com.faithnmn.learnenglish.service;

import java.util.ArrayList;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.faithnmn.learnenglish.listeners.FeedsListener;

public class FeedReceiver extends BroadcastReceiver {
	public static final String ACTION = "feed_receiver_action";
	private FeedsListener feedsListener;
	
	public FeedReceiver(FeedsListener feedsListener){
		this.feedsListener = feedsListener;
	}
	
	@Override
	public void onReceive(Context context, Intent intent) {
		if(intent != null && intent.hasExtra("feeds")){
			ArrayList<String> updateList = intent.getStringArrayListExtra("feeds");
			if(feedsListener != null){
				feedsListener.onReceiveFeeds(updateList);
			}
		}
		
	}

}
